package com.looso.sfolder.ui;

import android.app.ProgressDialog;
import android.content.Context;
import android.view.KeyEvent;

public abstract class LoadingProgressDialog extends ProgressDialog{
	
	
	public LoadingProgressDialog(Context context) {
		super(context);	
	}
	@Override
	public void onStart() {			
		super.onStart();
		Thread thread = new Thread(){
			@Override
			public void run() {
				load();
			}
		};
		thread.start();
	}		
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK){				
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
	
	protected abstract void load();
}
